/**
 * Created by mengkeys on 2016-12-26.
 */

var mongoose = require('mongoose');
var Schema = mongoose.Schema;

/* 用户模型  */

var UserSchema = new Schema({
    id: Number,
    nickname: String,
    email: String,
    password: String,
    avatar: String,
    motto: String
});

var BlogSchema = new Schema({
    title: String,
    author:String
});

var CommentSchema = new Schema({

});


/* 面向对象 */
/* 属性，方法 */
UserSchema.methods.findOne = function (option, callback) {
    var user = new UserSchema();
    user.findOne()
};

exports.user = mongoose.model('User', UserSchema);
exports.blog = mongoose.model('Blog', BlogSchema);
exports.comment = mongoose.model('Comment', CommentSchema);
